<script setup>
import { ref } from 'vue'

// 个人信息数据
const userInfo = ref({
  name: '张三',
  email: 'zhangsan@example.com',
  phone: '13800138000',
  department: '心理健康中心',
  position: '心理咨询师',
  avatar: ''
})

// 修改个人信息
const editUserInfo = () => {
  console.log('编辑个人信息')
}

// 修改密码
const changePassword = () => {
  console.log('修改密码')
}
</script>

<template>
  <div class="personal-center">
    <div class="header">
      <h2>个人中心</h2>
    </div>
    
    <div class="content">
      <!-- 个人信息卡片 -->
      <div class="info-card">
        <div class="avatar-section">
          <div class="avatar">
            <el-icon size="60"><User /></el-icon>
          </div>
          <div class="user-basic">
            <h3>{{ userInfo.name }}</h3>
            <p>{{ userInfo.position }}</p>
          </div>
        </div>
        
        <div class="info-details">
          <div class="info-item">
            <label>姓名：</label>
            <span>{{ userInfo.name }}</span>
          </div>
          <div class="info-item">
            <label>邮箱：</label>
            <span>{{ userInfo.email }}</span>
          </div>
          <div class="info-item">
            <label>电话：</label>
            <span>{{ userInfo.phone }}</span>
          </div>
          <div class="info-item">
            <label>部门：</label>
            <span>{{ userInfo.department }}</span>
          </div>
          <div class="info-item">
            <label>职位：</label>
            <span>{{ userInfo.position }}</span>
          </div>
        </div>
        
        <div class="actions">
          <el-button type="primary" @click="editUserInfo">编辑信息</el-button>
          <el-button @click="changePassword">修改密码</el-button>
        </div>
      </div>
    </div>
  </div>
</template>

<style scoped>
.personal-center {
  padding: 20px;
  background-color: #f5f7fa;
  min-height: 570px;
}

.header {
  margin-bottom: 20px;
}

.header h2 {
  color: #333;
  font-size: 24px;
  font-weight: 500;
}

.content {
  max-width: 800px;
}

.info-card {
  background: white;
  border-radius: 8px;
  padding: 30px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.avatar-section {
  display: flex;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 20px;
  color: #999;
}

.user-basic h3 {
  margin: 0 0 5px 0;
  font-size: 20px;
  color: #333;
}

.user-basic p {
  margin: 0;
  color: #666;
  font-size: 14px;
}

.info-details {
  margin-bottom: 30px;
}

.info-item {
  display: flex;
  margin-bottom: 15px;
  align-items: center;
}

.info-item label {
  width: 80px;
  color: #666;
  font-weight: 500;
}

.info-item span {
  color: #333;
}

.actions {
  display: flex;
  gap: 10px;
}
</style>